﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using Beaker.FileSystem;

namespace OpenCube.IO.Overload
{
	internal class OverloadingFileSystem
		: OverloadingFolder, IFileSystem
	{
		public OverloadingFileSystem(IEnumerable<IFolder> folders)
			: base(null, folders)
		{
			Contract.Requires<ArgumentNullException>(folders != null, "At least one folder is required.");
			Contract.Requires<ArgumentException>(folders.Any(), "At least one folder is required.");
		}

		/// <summary>
		/// Parse the given path and return a file or folder for it
		/// </summary>
		/// <param name="path">The path to parse</param>
		/// <returns>A IFileSystemEntry with the file or folder, or <c>null</c> when the file or folder does not exist</returns>
		/// <exception cref="FormatException">Thrown when the path could not be parsed.</exception>
		public IFileSystemEntry ParsePath(string path)
		{
			throw new NotSupportedException();
		}

		public IFileSystemEntry ParseRelativePath(IFolder relativeTo, string relativePath)
		{
			throw new NotSupportedException();
		}
	}
}